﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Report.WebApi.Interfaces;
using Report.WebApi.Models;
using Report.WebApi.Models.ResponseModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Report.WebApi.Controllers
{
    [Route("api/zhbb")]
    [ApiController]
    public class QueryZHBBController : ControllerBase
    {
        private readonly IQuerySQXService _service;
        private readonly IQueryWCLService _wclService;
        private readonly IQueryWXSQSService _wxsqsService;
        private readonly IQueryCQLService _cqlService;
        private readonly IQuerySPSCService _spscService;
        private readonly IQueryDPSQService _dpsqService;
        private readonly IQueryWXLBService _wxlbService;
        private readonly IQueryWXZLService _wxzlService;
        private readonly IQueryXYDService _xydService;
        private readonly IQueryWXFYService _wxfyService;
        private readonly IQueryGYSWXFYService _gyswxfyService;
        public QueryZHBBController(IQuerySQXService queryService, IQueryWCLService wclService, IQueryCQLService cqlService
            , IQueryWXSQSService wxsqsService
            , IQuerySPSCService spscService
            , IQueryDPSQService dpsqService
            , IQueryWXLBService wxlbService
            , IQueryWXZLService wxzlService
            , IQueryXYDService xydService
            , IQueryWXFYService wxfyService
            , IQueryGYSWXFYService gyswxfyService)
        {

            _service = queryService;
            _wclService = wclService;
            _cqlService = cqlService;
            _wxsqsService = wxsqsService;
            _spscService = spscService;
            _dpsqService = dpsqService;
            _wxlbService = wxlbService;
            _wxzlService = wxzlService;
            _xydService = xydService;
            _wxfyService = wxfyService;
            _gyswxfyService = gyswxfyService;
        }
        //申请项
        [HttpPost]
        [Route("sqx")]
        public async Task<SQXResponse> QuerySQX([FromBody] QueryRequestModel request)
        {
            return await _service.GetHomePageData(request);
        }
        //完成率
        [HttpPost]
        [Route("wcl")]
        public async Task<WCLResponse> QueryWCL([FromBody] QueryRequestModel request)
        {
            return await _wclService.GetHomePageData(request);
        }
        //超期率
        [HttpPost]
        [Route("cql")]
        public async Task<CQLResponse> QueryCQL([FromBody] QueryRequestModel request)
        {
            return await _cqlService.GetHomePageData(request);
        }
        //维修申请书
        [HttpPost]
        [Route("wxsqs")]
        public async Task<SQXResponse> QueryWXSQS([FromBody] QueryRequestModel request)
        {
            return await _wxsqsService.GetHomePageData(request);
        }
        //审批时长/响应时长
        [HttpPost]
        [Route("spsc")]
        public async Task<SPSCResponse> QuerySPSC([FromBody] QueryRequestModel request)
        {
            return await _spscService.GetHomePageData(request);
        }

        //店铺申请数
        [HttpPost]
        [Route("dpsq")]
        public async Task<List<DPSQResponse>> QueryDPSQ([FromBody] QueryRequestModel request)
        {
            return await _dpsqService.GetHomePageData(request);
        }
        //维修类别
        [HttpPost]
        [Route("wxlb")]
        public async Task<List<WXLBResponse>> QueryWXLB([FromBody] QueryRequestModel request)
        {
            return await _wxlbService.GetHomePageData(request);
        }
        //维修质量
        [HttpPost]
        [Route("wxzl")]
        public async Task<List<WXZLResponse>> QueryWXZL([FromBody] QueryRequestModel request)
        {
            return await _wxzlService.GetHomePageData(request);
        }
        //信用度
        [HttpPost]
        [Route("xyd")]
        public async Task<List<XYDResponse>> QueryXYD([FromBody] QueryRequestModel request)
        {
            return await _xydService.GetHomePageData(request);
        }
        //维修费用
        [HttpPost]
        [Route("wxfy")]
        public async Task<WXFYResponse> QueryWXFY([FromBody] QueryRequestModel request)
        {
            return await _wxfyService.GetHomePageData(request);
        }
        //供应商维修费用
        [HttpPost]
        [Route("gyswxfy")]
        public async Task<List<GYSWXFYResponse>> QueryGYSWXFY([FromBody] QueryRequestModel request)
        {
            return await _gyswxfyService.GetHomePageData(request);
        }
    }
}
